﻿using System.Web.Mvc;
using Wedn.Net.Common;

namespace Wedn.Net.Admin
{
    /// <summary>
    /// Admin区域注册
    /// </summary>
    public class AdminAreaRegistration : AreaRegistration
    {
        /// <summary>
        /// 获取要注册的区域的名称。
        /// </summary>
        /// <returns>要注册的区域的名称。</returns>
        public override string AreaName
        {
            get
            {
                return Setting.AdminAreaName;
            }
        }

        /// <summary>
        /// 注册Admin区域
        /// </summary>
        /// <param name="context">上下文</param>
        public override void RegisterArea(AreaRegistrationContext context)
        {
            context.MapRoute(
                Setting.AdminAreaName + "_default",
                Setting.AdminAreaName + "/{controller}/{action}/",
                new { controller = "Dashboard", action = "Index"},
                new[] { "Wedn.Net.Admin.Controllers" }
            );
        }
    }
}
